﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Text;
using System.Collections.Generic;
using Entity;
using BAL;
using Common;
namespace Web
{
    public partial class GetData : System.Web.UI.Page
    {
        private string q = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Page.Response.Expires = 0;
            if (Request.QueryString["q"] != null && Request.QueryString["q"] != "")
            {
                q = Request.QueryString["q"].ToLower();
            }
            else
            {
                return;
                Response.End();
            }

            if (!IsPostBack)
            {
                GetUser(q, 15);
            }
        }

        protected void GetUser(string q, int count)
        {
            StringBuilder sb = new StringBuilder();
            IList<UserInfo> userinfos = new List<UserInfo>();
            userinfos = Users.GetUserInfosByPinYin(q, count);
            foreach (UserInfo info in userinfos)
            {
                sb.AppendLine(info.Name + "|" + info.Email);
            }
            Response.Write(sb.ToString());
        }
    }
}
